package com.fishingwithme.domain.user;

import com.fishingwithme.infrastructure.WeChatUserInfo;
import com.fishingwithme.infrastructure.dtos.CodeVerifyDto;
import com.fishingwithme.infrastructure.dtos.UserInfoDto;
import com.fishingwithme.infrastructure.dtos.UserPageDto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;

public interface UserService {
    IPage<UserPageDto> getUserPage(int pageNum, int pageSize);
    SpotUser findOrCreateUser(WeChatUserInfo weChatUserInfo);
    SpotUser loadUserByOpenId(String openId);

    UserInfoDto loadUserByUserId();

    SpotUser loadUserByUserId(Long userId);

    SpotUser loadUserByName(String username);

    Boolean sendingEmail(String email);

    CodeVerifyDto saveUserEmail(CodeVerifyDto email);

    String saveUserNickName(String nickname);

    String saveUserAvatar(String avatar);

    Integer saveUserGender(Integer gender);

    boolean logout();

    Boolean cancel(Boolean status);

    CodeVerifyDto verifyEmailCode(Integer data);

    /**
     * 根据用户名搜索用户，限制返回10条结果
     * @param username 用户名关键字
     * @return 用户列表
     */
    List<UserPageDto> searchUsersByName(String username);

    /**
     * 切换用户管理员权限
     * @param userId 用户ID
     * @param isAdmin 是否设为管理员
     * @return 操作结果
     */
    Boolean switchAdmin(Long userId, Boolean isAdmin);
    Boolean cancel(Boolean status, Long id);
}